package com.cmc.cloud.cmclink.doc.api.document;


import com.cmc.cloud.cmclink.doc.api.document.rep.*;
import com.cmc.cloud.cmclink.doc.api.document.req.CheckSoCombineSiVO;
import com.cmc.cloud.cmclink.doc.api.document.req.so.*;
import com.cmc.cloud.cmclink.doc.constant.DocApiConstants;
import com.cmes.framework.common.pojo.CommonResult;
import com.cmes.framework.common.pojo.PageResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * 订舱拆分合并
 *
 * @author codegen
 */
@FeignClient(name = DocApiConstants.NAME)
@Tag(name = "RPC - 服务 订舱拆分合并")
public interface SoSplitCombineApi {

    String PREFIX = DocApiConstants.PREFIX + "/so-split-combine";
    /**
     * 获得可以并单的订单列表
     *
     * @param soPageReqDto
     * @return
     */
    @PostMapping(PREFIX + "/query")
    @Operation(summary = "获取可以并单的订单列表")
    CommonResult<PageResult<SoRespDto>> querySoInfo(@RequestBody @Valid SoPageReqDto soPageReqDto);

    /**
     * 获得订舱详细为了拆分
     *
     * @param soId
     * @return
     */
    @Operation(summary = "获得订舱详细为了拆分")
    @GetMapping(PREFIX+"/getSoDetailForSplit/{soId}")
    @Parameter(name = "soId", description = "soId", required = true, example = "123")
    CommonResult<SoDetailRespDto> getSoDetailForSplitAndCombine(
            @PathVariable("soId") Long soId);

    /**
     * 获得订舱详情多个列表为了合并
     *
     * @param soIds
     * @return
     */
    @Operation(summary = "获得订舱详情多个列表为了合并")
    @PostMapping(PREFIX+"/getSoDetailListForCombine")
    CommonResult<List<SoDetailRespDto>> getSoDetailListForSplitAndCombine(
            @RequestBody List<Long> soIds);

    /**
     * 创建订舱拆分
     *
     * @param createReqDto
     * @return
     */
    @Operation(summary = "创建订舱拆分")
    @PostMapping(PREFIX+"/createSoSplit")
    CommonResult<Void> createSoSplit(
            @Valid @RequestBody SoSplitCreateReqDto createReqDto);

    /**
     * 创建订舱合并
     *
     * @param updateReqDto
     * @return
     */
    @Operation(summary = "创建订舱合并")
    @PostMapping(PREFIX+"/createSoCombine")
    CommonResult<Void> createSoCombine(
            @Valid @RequestBody SoCombineCreateReqDto updateReqDto);

    /**
     * 获得订舱拆分合并详情
     *
     * @param splitCombineId
     * @return
     */
    @Operation(summary = "获得订舱拆分合并详情")
    @GetMapping(PREFIX+"/getSoSplitCombineDetail/{splitCombineId}")
    @Parameter(name = "splitCombineId", description = "编号", required = true, example = "1024")
    CommonResult<SoSplitCombineAllRespDto> getSoSplitCombineDetail(
            @PathVariable("splitCombineId") Long splitCombineId);

    /**
     * 获得订舱拆分合并记录表  分页
     *
     * @param pageDto
     * @return
     */
    @Operation(summary = "获得订舱拆分合并记录表  分页")
    @PostMapping(PREFIX+"/getSoSplitCombinePage")
    CommonResult<PageResult<SoSplitCombinePageRespDto>> getSoSplitCombinePage(
            @Valid @RequestBody SoSplitCombinePageReqDto pageDto);


    /**
     * 根据主订舱号查询可合并的订舱号
     *
     * @param bookingNo
     * @param csmCode
     * @return list
     */
    @Operation(summary = "根据主订舱号查询可合并的订舱号")
    @GetMapping(PREFIX+"/getCombineBookingNoList/{bookingNo}/{csmCode}")
    CommonResult<List<SoBookingNoVO>> getCombineBookingNoList(@PathVariable("bookingNo") String bookingNo,@PathVariable("csmCode") String csmCode);

    /**
     * 检查订舱是否可创建si
     *
     * @param dto
     * @return list
     */
    @Operation(summary = "检查订舱是否可创建si")
    @PostMapping(PREFIX+"/checkSoCombineSi")
    CommonResult<List<CheckSoCombineSiVO>> checkSoCombineSi(@RequestBody BlnoForecastReqDto dto);

    /**
     * 多so合si 保存草稿
     * @param dto
     * @return
     */
    @Operation(summary = "多so合si 保存草稿")
    @PostMapping(PREFIX +"/createSoCombineSi")
    CommonResult<Long> createSoCombineSi(@Valid @RequestBody BlnoMultipleSoCreateDto dto);

    /**
     * 多so合si 提交
     * @param dto
     * @return
     */
    @Operation(summary = "多so合si 提交")
    @PostMapping(PREFIX +"/commitSoCombineSi")
    CommonResult<Long> commitSoCombineSi(@Valid @RequestBody BlnoMultipleSoCreateDto dto);

    /**
     * 获取多个so的 预配箱信息
     * @param dto
     * @return
     */
    @Operation(summary = "获取多个so的 预配箱信息")
    @PostMapping(PREFIX +"/getForecastInfo")
    CommonResult<List<SoForecastRespVO>> getForecastInfo(@RequestBody BlnoForecastReqDto dto);
}
